<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let result = new Promise(function(res,rej){
            console.log('promise正在执行')
            let asd = 200;
            rej(asd)
        }).then((data)=>{
            console.log('成功')
        }).catch((err)=>{
            console.log('失败')//异步操作失败时其接收一个回调函数
        })
    </script>
</body>
</html>